package stream_demo;

import java.util.ArrayList;
import java.util.Collections;

public class demo1 {
    public static void main(String[] args) {
        //单列集合的stream流
        ArrayList<String> list1=new ArrayList<>();
        Collections.addAll(list1,"bbb","ccc","ddd","aaa","ddd");
        //获取一条流水线，并把数据放到流水线
//        Stream<String> stream = list1.stream();
        //遍历流水线
//        stream.forEach(new Consumer<String>() {
//            @Override
//            public void accept(String s) {
//                System.out.println(s);
//            }
//        });

        //链式
        list1.stream().forEach(s-> System.out.println(s));
    }
}
